package com.earthchen.demo.dao;

import com.earthchen.SuperMapper;
import com.earthchen.core.support.shiro.rule.RolePermRule;
import com.earthchen.demo.domain.SysResource;

import java.util.List;

/**
 * @author earthchen
 * @date 2018/9/4
 **/
public interface SysResourceDao extends SuperMapper<SysResource> {


    List<RolePermRule> selectRoleRules();

    /**
     * 根据角色id查询资源
     *
     * @param roleId
     * @return
     */
    List<SysResource> selectApisByRoleId(Long roleId);

    /**
     * 获取角色(roleId)所被授权的menu资源
     *
     * @param roleId
     * @return
     */
    List<SysResource> selectMenusByRoleId(long roleId);

    /**
     * 获取用户被授权菜单
     *
     * @param userId
     * @return
     */
    List<SysResource> getAuthorityMenusByUserId(Long userId);
}
